package backend.majiong.yaku.yakuman;

import java.util.ArrayList;
import java.util.List;

import backend.MainGame;
import backend.majiong.Pai;
import backend.majiong.Player;
import backend.majiong.yaku.AbstractYaku;
import backend.majiong.yaku.HandCombo;

public class Ryuuisou extends AbstractYaku {

    @Override
    public boolean checkYaku(Player player, HandCombo combo, MainGame mainGame) {
        List<Integer> nums = new ArrayList<Integer>();
        nums.add(2);
        nums.add(3);
        nums.add(4);
        nums.add(6);
        nums.add(8);
        for (Pai pai : combo.getAllHandPai()) {
            if (Pai.TYPE_ZI.equals(pai.getType()) && Pai.ZI_FA.equals(pai.getNum())) {
                continue;
            }
            if (Pai.TYPE_SOU.equals(pai.getType()) && nums.contains(pai.getNum())) {
                continue;
            }
            return false;
        }
        return true;
    }

    @Override
    public String getYakuName() {
        return "绿一色";
    }

    @Override
    public Integer getYakuNum(boolean isMenQing) {
        return 13;
    }

}
